tdf#120735 sw: clear the font cache text glyphs when layout finished
The motivation for remembering the text glyphs was to avoid repeated layout
calls during one sw layout run, this still preserves that optimization.
Approximate numbers for memory usage after importing the bugdoc finished:
- old: 401MB
- new 366MB (91% of baseline)
Change-Id: Ie960c606a8246c9c696745b2dcc9a49c3c570c07
Reviewed-on: https://gerrit.libreoffice.org/62496
Reviewed-by: Miklos Vajna <vmiklos@collabora.co.uk>
Tested-by: Jenkins
diff --git a/sw/source/core/layout/layact.cxx b/sw/source/core/layout/layact.cxx
index 3923725..d4cd2b3 100644
--- a/sw/source/core/layout/layact.cxx
+++ b/sw/source/core/layout/layact.cxx
@@ -58,6 +58,7 @@
#include <acmplwrd.hxx>
#include <sortedobjs.hxx>
#include <objectformatter.hxx>
#include <fntcache.hxx>
#include <vector>
// Save some typing work to avoid accessing destroyed pages.
@@ -2271,6 +2272,9 @@
pRoot->ResetIdleFormat();
SfxObjectShell* pDocShell = pImp->GetShell()->GetDoc()->GetDocShell();
pDocShell->Broadcast( SfxEventHint( SfxEventHintId::SwEventLayoutFinished, SwDocShell::GetEventName(STR_SW_EVENT_LAYOUT_FINISHED), pDocShell ) );
// Limit lifetime of the text glyphs cache to a single run of the
// layout.
SwClearFntCacheTextGlyphs();
}
}